﻿Public Class ViewModelParametrageAvance
    Inherits ViewModelTabSectionBase

    Private _ReferenceProjection As DataView
    Private _ParametrageAvance As DataView
    Private _Parametre As String

    Public ReadOnly Property ReferenceProjection As DataView
        Get
            If _ReferenceProjection Is Nothing Then
                Dim datamanager = New DataManager()
                _ReferenceProjection = New DataView(datamanager.Dataset.ReferenceProjection)
            End If

            Return _ReferenceProjection
        End Get
    End Property

    Public ReadOnly Property ParametrageAvance As DataView
        Get
            If _ParametrageAvance Is Nothing Then
                Dim datamanager = New DataManager()
                _ParametrageAvance = New DataView(datamanager.Dataset.ParametrageAvance)
            End If

            Return _ParametrageAvance
        End Get
    End Property

    Public ReadOnly Property ListeParametre As List(Of String)
        Get
            Return New List(Of String)(New String() { _
                                       "Taux Commission Banque", _
                                       "Taux Commission Gestionnaire", _
                                       "Taux Frais Selection Medical", _
                                       "Quote Part Coassurance", _
                                       "Taux Cession Reassurance", _
                                       "Taux Commission Reassurance", _
                                       "Coefficient Prime Nouvelle Generation", _
                                       "Coefficient Sinistre Nouvelle Generation"
                                   })
        End Get
    End Property

    Public Property Parametre As String
        Get
            Return _Parametre
        End Get
        Set(value As String)
            _Parametre = value

            _ParametrageAvance.RowFilter = "Parametre='" & value & "'"

            OnPropertyChanged("Parametre")
        End Set
    End Property

    Sub New()
        _Parametre = ListeParametre(0)
    End Sub
End Class
